﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dycox.Reporting
{
    public class DataSheet
    {
        DataSheetConfig _config;

        public DataSheetConfig Config
        {
            get { return _config; }
        }

        public DataSheet(DataSheetConfig config)
        {
            if (config == null)
                throw new ArgumentNullException("config");

            _config = config;
            _rows = new DataSheetRowCollection(this);
        }

        public DataSheetColumnCollection Columns
        {
            get { return _config.Columns; }
        }

        private DataSheetRowCollection _rows;

        public DataSheetRowCollection Rows
        {
            get { return _rows; }
        }

        public string Caption
        {
            get { return _config.Caption; }
        }

        public void Export(DataSheetExporter exporter, object argument)
        {
            exporter.Save(this, argument);
        }
    }
}
